Syntax to make #include file work??

This works:
#include <\\sharename\path\subdur\include_file.dxl>

But I can't figure out how to make this work if the include file is not on a share
(in other words, if the path doesn't have two leading backslashes I can't get it to work).

E.G. how do I include a file from my local PC, say the C drive???
I.E. from directory C\Program Files\Telelogic\DOORS_8.1\lib\dxl\addins\user

Regards, Strathglass
strathglass - Thu Apr 02 09:14:08 EDT 2009

Re: Syntax to make #include file work??
strathglass - Thu Apr 02 11:02:56 EDT 2009

Played around enought to figure out a solution; this works:

#include <c://some//path//here//include_file.dxl>
Regards, Strathglass

Re: Syntax to make #include file work??
dpechacek - Thu Apr 02 13:13:46 EDT 2009

strathglass - Thu Apr 02 11:02:56 EDT 2009
Played around enought to figure out a solution; this works:

#include <c://some//path//here//include_file.dxl>
Regards, Strathglass

For network paths you do it the way you did with .

For local paths, do #include "filepath".

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Syntax to make #include file work??
llandale - Thu Apr 02 14:28:08 EDT 2009

Note that you can use incomplete paths that are relative to your install-DXL directory. These two both work:

#include <C:\Program Files\Telelogic\DOORS_8.1\lib\dxl\config\baseWindowCallbacks.inc>
#include                                              <config\baseWindowCallbacks.inc>

 


Additionally, if you specify environment variable 'addins' as "c:\Doors-Stuff\DXL-Local", these both work:

 

 

 

#include <c:\Doors-Stuff\DXL-Local\Includes\Lib-Version.inc>
#include                          <Includes\Lib-Version.inc>



If you use the double-quotes form of #include instead of carrots , front slashes must be escaped. The first below fails even though it works with carrots (as above), the 2nd one works:



 

 

 

#include "Includes\Lib-Version.inc"       // This fails
#include "Includes\\Lib-Version.inc"      // This works.



Understand that the #including is done before any parsing, so you cannot have some clever DXL that checks the existence of a file before attempting to include it. Also, if you #include some file inside a structure such as an if-then-else, then the definitions are not avaible afterwards, since that context is over.

Understand that if you put #include files in layout or attr DXL, then EVERYBODY who uses that view or attribute MUST have direct access to that file, otherwise they are greeted with lots of rude DXL errors. Only very small or very controlled deployments qualify; thus #includes rarely work in Layout and Attr DXL.

>Louie



 

Re: Syntax to make #include file work??
strathglass - Thu Apr 02 15:59:06 EDT 2009

llandale - Thu Apr 02 14:28:08 EDT 2009

Note that you can use incomplete paths that are relative to your install-DXL directory. These two both work:

#include <C:\Program Files\Telelogic\DOORS_8.1\lib\dxl\config\baseWindowCallbacks.inc>
#include                                              <config\baseWindowCallbacks.inc>

 


Additionally, if you specify environment variable 'addins' as "c:\Doors-Stuff\DXL-Local", these both work:

 

 

 

#include <c:\Doors-Stuff\DXL-Local\Includes\Lib-Version.inc>
#include                          <Includes\Lib-Version.inc>



If you use the double-quotes form of #include instead of carrots , front slashes must be escaped. The first below fails even though it works with carrots (as above), the 2nd one works:



 

 

 

#include "Includes\Lib-Version.inc"       // This fails
#include "Includes\\Lib-Version.inc"      // This works.



Understand that the #including is done before any parsing, so you cannot have some clever DXL that checks the existence of a file before attempting to include it. Also, if you #include some file inside a structure such as an if-then-else, then the definitions are not avaible afterwards, since that context is over.

Understand that if you put #include files in layout or attr DXL, then EVERYBODY who uses that view or attribute MUST have direct access to that file, otherwise they are greeted with lots of rude DXL errors. Only very small or very controlled deployments qualify; thus #includes rarely work in Layout and Attr DXL.

>Louie



 

Good extra info guys - thanks!

Regards, Strathglass.

Re: Syntax to make #include file work??
Salo33 - Fri May 27 13:23:15 EDT 2016

-E- DXL: <d:\addin\ExcelFunctions.inc:9> could not open include file (ole.inc) (No such file or directory)
Included from:
    <Line:58>
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.

 

After including the file i have this error. Could anybody  help me how to fix this error ?

Thanks

Regards,

Salo

 

Re: Syntax to make #include file work??
strathglass - Fri May 27 14:12:10 EDT 2016

Salo33 - Fri May 27 13:23:15 EDT 2016

-E- DXL: <d:\addin\ExcelFunctions.inc:9> could not open include file (ole.inc) (No such file or directory)
Included from:
    <Line:58>
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.

 

After including the file i have this error. Could anybody  help me how to fix this error ?

Thanks

Regards,

Salo

 

What does your source code include line look like?

Looks like you probably have that wrong, but need to see it to know what is happening.

Also is env variable "addins" defined? If so, as what?

Re: Syntax to make #include file work??
Salo33 - Wed Jun 01 06:49:28 EDT 2016

This is my source code for including files

#include <D:\addin\ExcelFunctions.inc> #include <D:\addin\ole.inc>

Also I have no env variable "addins" defined.
How can I defined it ?
Thanks
Kind Regards,
Salo

 

Re: Syntax to make #include file work??
strathglass - Wed Jun 01 07:04:59 EDT 2016

Salo33 - Wed Jun 01 06:49:28 EDT 2016

This is my source code for including files

#include <D:\addin\ExcelFunctions.inc> #include <D:\addin\ole.inc>

Also I have no env variable "addins" defined.
How can I defined it ?
Thanks
Kind Regards,
Salo

 

Works fine for me. Of course you need to have those two files existing...do you includce files existing as per:

D:\addin\ExcelFunctions.inc

and...

D:\addin\ole.inc

?

If not, of course it won't work!

As Louie has noted, to include DOORS-provided include files, you can use relative paths:

#include <utils\ole.inc>

Re: Syntax to make #include file work??
Salo33 - Wed Jun 01 07:15:06 EDT 2016

Yes sure my files are exisiting in the directory addin.

But I dont know why I have this error.

-E- DXL: <D:/addin/ExcelFunctions.inc:9> could not open include file (ole.inc) (No such file or directory)
Included from:
    <Line:57>
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.

 

Re: Syntax to make #include file work??
strathglass - Wed Jun 01 08:00:59 EDT 2016

Salo33 - Wed Jun 01 07:15:06 EDT 2016

Yes sure my files are exisiting in the directory addin.

But I dont know why I have this error.

-E- DXL: <D:/addin/ExcelFunctions.inc:9> could not open include file (ole.inc) (No such file or directory)
Included from:
    <Line:57>
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.

 

Looking at the error message, looks like ExcelFunctions.inc line 9 has an include file (ole.inc) that can't be found: what is line 9 in ExcelFunctions.inc say exactly?

Re: Syntax to make #include file work??
Salo33 - Wed Jun 01 09:07:16 EDT 2016

strathglass - Wed Jun 01 08:00:59 EDT 2016

Looking at the error message, looks like ExcelFunctions.inc line 9 has an include file (ole.inc) that can't be found: what is line 9 in ExcelFunctions.inc say exactly?

Thank you very much you are right. I did not include that (ole.inc) file.

Now it works fine when I include it.

Thanks